package cn.iocoder.yudao.module.acm.controller.app.onboardsupplyplan;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.acm.controller.app.onboardsupplyplan.vo.AppOnboardProducePlanPageReqVO;
import cn.iocoder.yudao.module.acm.controller.app.onboardsupplyplan.vo.AppOnboardProducePlanRespVO;
import cn.iocoder.yudao.module.acm.service.onboardproduceplan.OnboardProducePlanService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户 APP - 航机管理-机供品生产计划")
@RestController
@RequestMapping("/pplan/onboard-produce-plan")
@Validated
public class AppOnboardProducePlanController {

    @Resource
    private OnboardProducePlanService onboardProducePlanService;

    //@PostMapping("/create")
    //@Operation(summary = "创建航机管理-机供品生产计划")
    //public CommonResult<Long> createOnboardSupplyPlan(@Valid @RequestBody AppOnboardSupplyPlanSaveReqVO createReqVO) {
    //    return success(onboardSupplyPlanService.createOnboardSupplyPlan(createReqVO));
    //}
    //
    //@PutMapping("/update")
    //@Operation(summary = "更新航机管理-机供品生产计划")
    //public CommonResult<Boolean> updateOnboardSupplyPlan(@Valid @RequestBody AppOnboardSupplyPlanSaveReqVO updateReqVO) {
    //    onboardSupplyPlanService.updateOnboardSupplyPlan(updateReqVO);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete")
    //@Operation(summary = "删除航机管理-机供品生产计划")
    //@Parameter(name = "id", description = "编号", required = true)
    //public CommonResult<Boolean> deleteOnboardSupplyPlan(@RequestParam("id") Long id) {
    //    onboardSupplyPlanService.deleteOnboardSupplyPlan(id);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete-list")
    //@Parameter(name = "ids", description = "编号", required = true)
    //@Operation(summary = "批量删除航机管理-机供品生产计划")
    //public CommonResult<Boolean> deleteOnboardSupplyPlanList(@RequestParam("ids") List<Long> ids) {
    //    onboardSupplyPlanService.deleteOnboardSupplyPlanListByIds(ids);
    //    return success(true);
    //}

    @GetMapping("/get")
    @Operation(summary = "获得航机管理-机供品生产计划")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<AppOnboardProducePlanRespVO> getOnboardProducePlan(@RequestParam("id") Long id) {
        AppOnboardProducePlanRespVO onboardSupplyPlan = onboardProducePlanService.appGetOnboardProducePlan(id);
        return success(onboardSupplyPlan);
    }

    @GetMapping("/page")
    @Operation(summary = "获得航机管理-机供品生产计划分页")
    public CommonResult<PageResult<AppOnboardProducePlanRespVO>> getOnboardProducePlanPage(@Valid AppOnboardProducePlanPageReqVO pageReqVO) {
        PageResult<AppOnboardProducePlanRespVO> pageResult = onboardProducePlanService.appGetOnboardProducePlanPage(pageReqVO);
        return success(pageResult);
    }

}